using UnityEngine;
using System.Collections;
using System.Collections.Generic;

public class ManagerGame : MonoBehaviour
{
	//Personagem para checar se morreu...
	public PlayerCharacterBehaviour p;
	
	//Acabou ?
	private bool finish = false;
	
	//Tempo de jogo...
	public static float timeGame = 0;
	
	public static bool enableAction = true;
	
	void Awake()
	{
		timeGame = 0;
		enableAction = true;
	}
	
	void Update()
	{
		timeGame += Time.deltaTime;
		
		if(!finish)
		{
			if(p == null)
			{
				finish = true;
				StartCoroutine(GameOver());
			}
		}
	}
	
	/// <summary>
	/// Corrotina de derrota
	/// </summary>
	/// <returns>
	/// The over.
	/// </returns>
	private IEnumerator GameOver()
	{
		yield return new WaitForSeconds(2);
		
		Application.LoadLevel("GameOver");
	}
}
